class RoleService {

    boolean transactional = true
    def authenticateService

    def serviceMethod() {

    }

    // 为老师加上班主任的职务
    private addMasterRole(def person) {  
		def config = authenticateService.securityConfig
		def teacherMasterRole = config.security.masterRole
		def role = Role.findByAuthority(teacherMasterRole)
		role.addToPeople(person) 
	}

    //  重置教师的角色为代课老师，即去除班主任职务
      private resetTeacher(def person) {
            if(Classes.countByMaster(person) == 0){
                def config = authenticateService.securityConfig
                def teacherMasterRole = config.security.masterRole
                def role = Role.findByAuthority(teacherMasterRole)
                role.removeFromPeople(person)
            }
            return 
      }
}
